package com.qiyi.player.base.flv
{
   import flash.net.ObjectEncoding;
   
   public class FLVTagScriptDataObject extends FLVTag
   {
      
      public function FLVTagScriptDataObject(param1:int = 18) {
         super(param1);
      }
      
      public function get objects() : Array {
         var _loc1_:Array = new Array();
         bytes.position = TAG_HEADER_BYTE_COUNT;
         while(bytes.bytesAvailable)
         {
            _loc1_.push(bytes.readObject());
         }
         return _loc1_;
      }
      
      private var _charset:String = "utf-8";
      
      public function set charset(param1:String) : void {
         this._charset = param1;
      }
      
      public function get metadata() : Object {
         var _loc2_:ScriptDataValue = null;
         bytes.position = TAG_HEADER_BYTE_COUNT;
         var _loc1_:ScriptDataValue = ScriptDataValue.read(bytes,this._charset);
         if(_loc1_.value == "onMetaData")
         {
            _loc2_ = ScriptDataValue.read(bytes,this._charset);
            return _loc2_.value;
         }
         return null;
      }
      
      public function set objects(param1:Array) : void {
         var _loc2_:Object = null;
         bytes.objectEncoding = ObjectEncoding.AMF0;
         bytes.length = TAG_HEADER_BYTE_COUNT;
         bytes.position = TAG_HEADER_BYTE_COUNT;
         for each(_loc2_ in param1)
         {
            bytes.writeObject(_loc2_);
         }
         dataSize = bytes.length - TAG_HEADER_BYTE_COUNT;
      }
   }
}
import flash.utils.ByteArray;

class ScriptDataValue extends Object
{
   
   function ScriptDataValue() {
      super();
   }
   
   public static function read(param1:ByteArray, param2:String) : ScriptDataValue {
      var _loc3_:ScriptDataValue = new ScriptDataValue();
      _loc3_.type = param1.readUnsignedByte();
      var _loc4_:* = 0;
      switch(_loc3_.type)
      {
         case 0:
            _loc3_.value = param1.readDouble();
            break;
         case 1:
            _loc3_.value = param1.readUnsignedByte();
            break;
         case 2:
            _loc3_.value = ScriptDataString.read(param1,param2);
            break;
         case 3:
            _loc3_.value = ScriptDataObject.read(param1,param2);
            break;
         case 7:
            _loc3_.value = param1.readUnsignedShort();
            break;
         case 8:
            _loc3_.value = ScriptDataECMAArray.read(param1,param2);
            break;
         case 10:
            _loc3_.value = ScriptDataStrictArray.read(param1,param2);
            break;
         case 11:
            _loc3_.value = new Date();
            _loc3_.value.millisecondsUTC = param1.readDouble();
            break;
         case 12:
            _loc3_.value = ScriptDataLongString.read(param1,param2);
            break;
      }
      return _loc3_;
   }
   
   public var type:int;
   
   public var value:Object;
}
import flash.utils.ByteArray;

class ScriptDataString extends Object
{
   
   function ScriptDataString() {
      super();
   }
   
   public static function read(param1:ByteArray, param2:String) : String {
      var _loc3_:int = param1.readUnsignedShort();
      return param1.readMultiByte(_loc3_,param2);
   }
}
import flash.utils.ByteArray;

class ScriptDataLongString extends Object
{
   
   function ScriptDataLongString() {
      super();
   }
   
   public static function read(param1:ByteArray, param2:String) : String {
      var _loc3_:int = param1.readUnsignedInt();
      return param1.readMultiByte(_loc3_,param2);
   }
}
import flash.utils.ByteArray;

class ScriptDataObjectProperty extends Object
{
   
   function ScriptDataObjectProperty() {
      super();
   }
   
   public static function read(param1:ByteArray, param2:String) : ScriptDataObjectProperty {
      var _loc3_:ScriptDataObjectProperty = new ScriptDataObjectProperty();
      _loc3_.name = ScriptDataString.read(param1,param2);
      _loc3_.value = ScriptDataValue.read(param1,param2);
      return _loc3_;
   }
   
   public var name:String;
   
   public var value:ScriptDataValue;
}
import flash.utils.ByteArray;

class ScriptDataObjectEnd extends Object
{
   
   function ScriptDataObjectEnd() {
      super();
   }
   
   public static function testEnd(param1:ByteArray) : Boolean {
      if(param1.bytesAvailable == 0)
      {
         return true;
      }
      var _loc2_:int = param1.readUnsignedByte();
      var _loc3_:int = param1.readUnsignedByte();
      var _loc4_:int = param1.readUnsignedByte();
      if(_loc2_ == 0 && _loc3_ == 0 && _loc4_ == 9)
      {
         return true;
      }
      param1.position = param1.position - 3;
      return false;
   }
}
import flash.utils.ByteArray;

class ScriptDataECMAArray extends Object
{
   
   function ScriptDataECMAArray() {
      super();
   }
   
   public static function read(param1:ByteArray, param2:String) : Array {
      var _loc4_:ScriptDataObjectProperty = null;
      var _loc3_:Array = [];
      param1.readUnsignedInt();
      while(!ScriptDataObjectEnd.testEnd(param1))
      {
         _loc4_ = ScriptDataObjectProperty.read(param1,param2);
         _loc3_[_loc4_.name] = _loc4_.value.value;
      }
      return _loc3_;
   }
}
import flash.utils.ByteArray;

class ScriptDataObject extends Object
{
   
   function ScriptDataObject() {
      super();
   }
   
   public static function read(param1:ByteArray, param2:String) : Object {
      var _loc4_:ScriptDataObjectProperty = null;
      var _loc3_:Object = {};
      while(!ScriptDataObjectEnd.testEnd(param1))
      {
         _loc4_ = ScriptDataObjectProperty.read(param1,param2);
         _loc3_[_loc4_.name] = _loc4_.value.value;
      }
      return _loc3_;
   }
}
import flash.utils.ByteArray;

class ScriptDataStrictArray extends Object
{
   
   function ScriptDataStrictArray() {
      super();
   }
   
   public static function read(param1:ByteArray, param2:String) : Array {
      var _loc6_:ScriptDataValue = null;
      var _loc3_:int = param1.readUnsignedInt();
      var _loc4_:Array = new Array(_loc3_);
      var _loc5_:* = 0;
      while(_loc5_ < _loc3_)
      {
         _loc6_ = ScriptDataValue.read(param1,param2);
         _loc4_[_loc5_] = _loc6_.value;
         _loc5_++;
      }
      return _loc4_;
   }
}
